
const myReserve = (str: string): string => {
    let lowStr = str.toLocaleLowerCase()
    let arr = lowStr.split('').reverse().join("")
    return arr
}
console.log("回文", myReserve("CBA"))



const my_loggerLitter = (arr: string[]): string => {
    let newArr: Array<string> = arr[0].split('')
    arr.forEach(item => {
        if (newArr.length < item.split('').length) {
            newArr = item.split('')
        }
    })
    return newArr.join('')
}

console.log("最长单词", my_loggerLitter(['city', "cityOfStar", "perfect"]))


const toHump = (str: string): string => {

    let arr: string[] = str.split(' ')
    let newStr: string = arr[0]
    for (let i = 1; i < arr.length; i++) {
        newStr += arr[i][0].toLocaleUpperCase() + arr[i].slice(1)
    }


    return newStr
}

console.log("转驼峰", toHump("i'm chasing perfection"))